package com.xiaotao.controller;

import com.nimbusds.jose.JOSEException;
import com.xiaotao.entity.Admin;
import com.xiaotao.service.AdminService;
import com.xiaotao.util.ResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "管理员相关")
@RestController
@RequestMapping("admin")
public class AdminController {
    @Resource
    private AdminService adminService;
    //管理员登录
    @ApiOperation(value = "登录接口")
    @PostMapping("login")
    public ResponseUtil login(@RequestBody Admin admin) throws JOSEException {
        return adminService.login(admin);
    }
}
